<?php

namespace app\common\model;

use app\common\controller\Helper;
use think\Model;

class LangClassFile extends Model
{
    use Helper;

    protected $table = 'lang_class_file';

    // 视频
    const TYPE_VIDEO = 1;
    // 音频
    const TYPE_AUDIO = 2;
    // 课件
    const TYPE_CLASS_FILE = 3;
    // 随堂作业
    const TYPE_HOMEWORK = 4;
    // 免费
    const FREE = 1;
    const FREE_NO = 0;

    // 语音课
    const COURSE_VOICE = 1;
    // 基础课
    const COURSE_BASE = 2;
    // 高级课
    const COURSE_SENIOR = 3;

    // 我的轨迹文件类型
    const WATCH_LOG_ARR = [self::TYPE_VIDEO, self::TYPE_AUDIO, self::TYPE_CLASS_FILE];

    public static function attributes($attribute, $key = null)
    {
        $list = [
            'is_free' => [
                self::FREE_NO => '否',
                self::FREE => '是',
            ],
            'type' => [
                self::TYPE_VIDEO => '视频',
                self::TYPE_AUDIO => '音频',
                self::TYPE_CLASS_FILE => '课件',
                self::TYPE_HOMEWORK => '随堂作业'
            ],
            'course_type' => [
                self::COURSE_VOICE => '语音课',
                self::COURSE_BASE => '基础课',
                self::COURSE_SENIOR => '高级课',
            ]
        ];
        return self::attributeReturn($list, $attribute, $key);
    }
}